{% extends 'base.html' %}
{% load static %}

{% block title %}删除通知 - 维修管理系统{% endblock %}

{% block content %}
<div class="container-fluid">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title mb-0">确认删除通知</h4>
                </div>
                <div class="card-body">
                    <div class="alert alert-warning">
                        <h5 class="alert-heading">⚠️ 警告</h5>
                        <p class="mb-0">您确定要删除以下通知吗？此操作不可撤销！</p>
                    </div>

                    <div class="card mb-4">
                        <div class="card-body">
                            <h5>{{ notification.title }}</h5>
                            <p class="text-muted">{{ notification.content|truncatewords:20 }}</p>
                            <div class="row">
                                <div class="col-md-6">
                                    <small><strong>目标角色:</strong> {{ notification.get_target_roles_display }}</small>
                                </div>
                                <div class="col-md-6">
                                    <small><strong>优先级:</strong> 
                                        <span class="badge bg-{{ notification.get_priority_class }}">
                                            {{ notification.get_priority_display }}
                                        </span>
                                    </small>
                                </div>
                            </div>
                            <div class="row mt-2">
                                <div class="col-md-6">
                                    <small><strong>有效期:</strong> {{ notification.start_date|date:"Y-m-d H:i" }} 至 {{ notification.end_date|date:"Y-m-d H:i" }}</small>
                                </div>
                                <div class="col-md-6">
                                    <small><strong>状态:</strong> 
                                        {% if notification.is_active %}
                                        <span class="badge bg-success">激活</span>
                                        {% else %}
                                        <span class="badge bg-warning">停用</span>
                                        {% endif %}
                                    </small>
                                </div>
                            </div>
                        </div>
                    </div>

                    <form method="post">
                        {% csrf_token %}
                        <div class="d-grid gap-2 d-md-flex">
                            <button type="submit" class="btn btn-danger me-md-2">
                                <i class="bi bi-trash"></i> 确认删除
                            </button>
                            <a href="{% url 'notifications:notification_list' %}" class="btn btn-secondary">
                                <i class="bi bi-arrow-left"></i> 取消返回
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
